<template>
  <div class="left">
    <el-menu
      router
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      :collapse="isCollapse"
    >
      <el-menu-item>
        <el-radio-group v-model="isCollapse">
          <i class="el-icon-plus" @click="changstatus()" v-if="isCollapse"></i>
          <i class="el-icon-minus" @click="changstatus()" v-else></i>
        </el-radio-group>
        <span slot="title" v-if="isCollapse">展开</span>
        <span slot="title" v-else>收起</span>
      </el-menu-item>
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-edit-outline"></i>
          <span slot="title">考试管理</span>
        </template>
        <el-menu-item-group>
          <el-menu-item index="1-1">
            <i class="el-icon-document"></i>考试安排
          </el-menu-item>
          <el-menu-item index="1-2">
            <i class="el-icon-edit"></i>补考申请
          </el-menu-item>
          <el-menu-item index="1-3">
            <i class="el-icon-edit"></i>缓考申请
          </el-menu-item>
          <el-menu-item index="1-4">
            <i class="el-icon-edit"></i>免考申请
          </el-menu-item>
          <el-menu-item index="1-5">
            <i class="el-icon-tickets"></i>考试报名
          </el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-menu-item index="2">
        <i class="el-icon-menu"></i>
        <span slot="title">成绩查询</span>
      </el-menu-item>
      <el-menu-item index="/studentcourse">
        <i class="el-icon-data-line"></i>
        <span slot="title">课表管理</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-chat-line-square"></i>
        <span slot="title">通知管理</span>
      </el-menu-item>
      <el-menu-item index="/studentInfo">
        <i class="el-icon-setting"></i>
        <span slot="title">个人信息</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: true
    };
  },
  created() {},
  mounted() {},
  methods: {
    changstatus() {
      this.isCollapse = !this.isCollapse;
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>

<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 300px;
}
.left {
  display: flex;
}
</style>
